CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
PROJECT(stdtracer)

SET(CMAKE_CXX_STANDARD 14)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)

ADD_DEFINITIONS(-Wfatal-errors)

INSTALL(DIRECTORY include DESTINATION .)

OPTION(BUILD_BENCHMARKS "Build benchmarks." OFF)
OPTION(BUILD_CUDA_EXAMPLES "Build cuda examples." OFF)
OPTION(BUILD_EXAMPLES "Build examples." OFF)
OPTION(BUILD_TESTS "Build tests." OFF)

IF(UNIX)
    ADD_DEFINITIONS(-DHAVE_UNISTD)
ENDIF()

IF(BUILD_TESTS)
    ENABLE_TESTING()
    INCLUDE(cmake/tests.cmake)
ENDIF()

IF(BUILD_BENCHMARKS)
    INCLUDE(cmake/benchmarks.cmake)
ENDIF()

IF(BUILD_EXAMPLES)
    INCLUDE(cmake/examples.cmake)
ENDIF()
IF(BUILD_CUDA_EXAMPLES)
    INCLUDE(cmake/cuda_examples.cmake)
ENDIF()

INCLUDE(cmake/package.cmake)
